package tcln.sors.model.base.dom;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

import org.hibernate.validator.Length;

import tcln.sors.model.core.dom.NamedEntity;

/**
 * Abstract entity having descriptive information (name, description...)
 * 
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
@MappedSuperclass
public abstract class AbstractSorsNamedEntity extends AbstractSorsEntity implements NamedEntity<Integer> {
    private static final long serialVersionUID = 1L;

    /**
     * Display name of this entity.
     */
    private String name;
    
    /**
     * Description about this entity.
     */
    private String description;

    /**
     * {@inheritDoc}
     */
    @Length(max = 200)
    @Column(name = "DISPLAY_NAME")
    public String getName() {
        return name;
    }

    /**
     * Sets new value for {@link #name}.
     * 
     * @param name
     *            the new name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * {@inheritDoc}
     */
    @Length(max = 500)
    @Column(name = "DESCRIPTION")
    public String getDescription() {
        return description;
    }

    /**
     * Sets new value for {@link #description}.
     * 
     * @param description
     *            the new description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
}
